
package makao;

import shared.Card;
/**
 *
 * @author gekon
 */
public class SuitFrame extends javax.swing.JFrame
{
    private MakaoView makaoView;
    private int result = 0;
    /** Creates new form ColorFrame */
    public SuitFrame(MakaoView makaoView)
    {
        initComponents();
        this.makaoView = makaoView;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jRadioButtonClub = new javax.swing.JRadioButton();
        jRadioButtonSpade = new javax.swing.JRadioButton();
        jRadioButtonDiamond = new javax.swing.JRadioButton();
        jRadioButtonHeart = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jButtonApprove = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(makao.MakaoApp.class).getContext().getResourceMap(SuitFrame.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setAlwaysOnTop(true);
        setMinimumSize(new java.awt.Dimension(360, 220));
        setName("Form"); // NOI18N
        setResizable(false);
        setUndecorated(true);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jRadioButtonClub.setBackground(resourceMap.getColor("jRadioButtonClub.background")); // NOI18N
        buttonGroup1.add(jRadioButtonClub);
        jRadioButtonClub.setSelected(true);
        jRadioButtonClub.setText(resourceMap.getString("jRadioButtonClub.text")); // NOI18N
        jRadioButtonClub.setName("jRadioButtonClub"); // NOI18N
        getContentPane().add(jRadioButtonClub, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, -1, 40));

        jRadioButtonSpade.setBackground(resourceMap.getColor("jRadioButtonSpade.background")); // NOI18N
        buttonGroup1.add(jRadioButtonSpade);
        jRadioButtonSpade.setText(resourceMap.getString("jRadioButtonSpade.text")); // NOI18N
        jRadioButtonSpade.setName("jRadioButtonSpade"); // NOI18N
        getContentPane().add(jRadioButtonSpade, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, 40));

        jRadioButtonDiamond.setBackground(resourceMap.getColor("jRadioButtonDiamond.background")); // NOI18N
        buttonGroup1.add(jRadioButtonDiamond);
        jRadioButtonDiamond.setText(resourceMap.getString("jRadioButtonDiamond.text")); // NOI18N
        jRadioButtonDiamond.setName("jRadioButtonDiamond"); // NOI18N
        getContentPane().add(jRadioButtonDiamond, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 50, -1, 40));

        jRadioButtonHeart.setBackground(resourceMap.getColor("jRadioButtonHeart.background")); // NOI18N
        buttonGroup1.add(jRadioButtonHeart);
        jRadioButtonHeart.setText(resourceMap.getString("jRadioButtonHeart.text")); // NOI18N
        jRadioButtonHeart.setName("jRadioButtonHeart"); // NOI18N
        getContentPane().add(jRadioButtonHeart, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 100, -1, 40));

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 10, -1, -1));

        jLabel2.setIcon(resourceMap.getIcon("jLabel2.icon")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(75, 100, -1, 40));

        jLabel3.setIcon(resourceMap.getIcon("jLabel3.icon")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(255, 50, -1, 40));

        jLabel4.setIcon(resourceMap.getIcon("jLabel4.icon")); // NOI18N
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 100, -1, 40));

        jLabel5.setIcon(resourceMap.getIcon("jLabel5.icon")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 50, -1, 40));

        jButtonApprove.setText(resourceMap.getString("jButtonApprove.text")); // NOI18N
        jButtonApprove.setName("jButtonApprove"); // NOI18N
        jButtonApprove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonApproveActionPerformed(evt);
            }
        });
        getContentPane().add(jButtonApprove, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 160, 250, 30));

        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel1.border.lineColor"), 7)); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 346, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 206, Short.MAX_VALUE)
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 360, 220));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonApproveActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonApproveActionPerformed
    {//GEN-HEADEREND:event_jButtonApproveActionPerformed
        // TODO add your handling code here:
        if( jRadioButtonClub.isSelected() )
            result = Card.CLUB;
        if( jRadioButtonSpade.isSelected() )
            result = Card.SPADE;
        if( jRadioButtonDiamond.isSelected() )
            result = Card.DIAMOND;
        if( jRadioButtonHeart.isSelected() )
            result = Card.HEART;
        
        this.setVisible(false);
        makaoView.getCardCacheFrame().demandSuit(result);
    }//GEN-LAST:event_jButtonApproveActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        /*try
        {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
            {
                if ("Nimbus".equals(info.getName()))
                {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex)
        {
            java.util.logging.Logger.getLogger(ColorFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex)
        {
            java.util.logging.Logger.getLogger(ColorFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex)
        {
            java.util.logging.Logger.getLogger(ColorFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex)
        {
            java.util.logging.Logger.getLogger(ColorFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable()
        {

            public void run()
            {
                //new ColorFrame(MakaoView).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButtonApprove;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioButtonClub;
    private javax.swing.JRadioButton jRadioButtonDiamond;
    private javax.swing.JRadioButton jRadioButtonHeart;
    private javax.swing.JRadioButton jRadioButtonSpade;
    // End of variables declaration//GEN-END:variables
}
